package BookStore.dao;


import BookStore.model.Vip_a_1;
import BookStore.util.VDbUtil;

import javax.swing.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Vip_aDao {
    private Vip_a_1 vip_a_1;

    public Vip_aDao(Vip_a_1 temp_a_1) {
        this.vip_a_1 = temp_a_1;
    }

    public void alter_1() throws Exception {
        Connection con_2_2 = VDbUtil.getCon_2_2();
        String sql_1 = "update Vip set  name = '"+vip_a_1.getVipName_2()+"', sex  = '"+vip_a_1.getVipSex_2()+"',tel = '"+vip_a_1.getVipTel_2()+"',lev = '"+vip_a_1.getVipLev_2()+"',discount = '"+vip_a_1.getVipDiscount_2()+"' where id = '"+vip_a_1.getVipId_2()+"'";
        PreparedStatement ps_2 = con_2_2.prepareStatement(sql_1);
        ResultSet alt = ps_2.executeQuery();
        JOptionPane.showMessageDialog(null,"会员修改成功");

        con_2_2.close();
        ps_2.close();
    }

}
